Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add periodic reporter #86

Merged
merged 21 commits into from
May 17, 2023
Merged

chore: add periodic reporter #86

merged 21 commits into from
May 17, 2023

Conversation

bharathkkb
Copy link
Member

No description provided.

@bharathkkb bharathkkb requested review from a team and gtsorbo as code owners May 16, 2023 19:21
@apeabody
Copy link
Contributor

apeabody commented May 16, 2023

@bharathkkb - This is probably the best example module for the required template (already includes branch): https://github.com/GoogleCloudPlatform/cloud-foundation-toolkit/tree/master/infra/terraform/modules/lint_file

@bharathkkb
Copy link
Member Author

Thanks @apeabody! Will add it there once I have it working.

@bharathkkb bharathkkb changed the title [do-not-merge]: add periodic reporter chore: add periodic reporter May 17, 2023
@bharathkkb
Copy link
Member Author

@apeabody this is ready for a review. I will add it via TF in a follow up once we have it soaked for a bit.

Copy link
Contributor

@apeabody apeabody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bharathkkb LGTM!

owner: 'GoogleCloudPlatform',
repo: 'terraform-google-secure-cicd',
state: 'open',
labels: [periodicLabel]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the future, might want to consider filtering on user.login and also title to minimize someone adding the label to a issue and it being returned.

await github.rest.issues.createComment({
...context.repo,
issue_number: prevIssues[0].number,
body: txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the future, it might be useful to include a warning in the update if multiple issues were returned prevIssues.length > 1

});
};

// updateAndCloseIssue comments on an existing issue and closes it. No-op if no issue exists.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit for the future: this function operates on all matching issues

Suggested change
// updateAndCloseIssue comments on an existing issue and closes it. No-op if no issue exists.
// updateAndCloseIssues comments on any existing issues and closes them. No-op if no issue exists.

@apeabody apeabody merged commit 7670542 into main May 17, 2023
@apeabody apeabody deleted the bharathkkb-patch-1 branch May 17, 2023 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants